import { createRouter, createWebHashHistory } from 'vue-router'
const login = () => import('../views/login.vue')
const User = () => import('../views/User.vue')
const Profile = () => import('../views/UserCenter/profile.vue')
const Settings = () => import('../views/UserCenter/settings.vue')

const routes = [
    { path: '/', redirect: '/login' },
    //登录页
    {
        path: '/login',
        name: 'login',
        component: login,
    },
    //用户中心页
    {
        path: '/user',
        name: 'user',
        component:User},
    //用户信息页
    {
        path:'/profile',
        name:'profile',
        component:Profile
    },
    //用户设置页
        {
            path:'/settings',
            name:'settings',
            component:Settings
        },

]
//创建vue-router实例并配置
const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

//输出实例对象
export default router